/*
 * User.h
 *
 *  Created on: 2013-1-29
 *      Author: Dspark
 */

#ifndef USER_H_
#define USER_H_
#include <QString>
#include <QDate>
class User {

public:
	enum Type{
			SaleManager = 0,  //营销经理
			Director, //区域领导
			Max
		};
	User();
	User(quint32 id,const QString& name, Type type);
	virtual ~User();
	quint32 getId(){
		return id;
	}
	QString& getName(){
		return name;
	}
	QString& getSignName(){
		return signName;
	}
	QString& getPassword(){
		return password;
	}
	bool isLocked(){
		return locked;
	}
	QDate& getCreateDate(){
		return createDate;
	}
	Type getType(){
		return type;
	}
	QString& getTypeString(){
		return getTypeString(type);
	}
	static QString& getTypeString(Type type){
		static QString typeNames[] = {"营销经理","区域领导"};
		return typeNames[type];
	}

	void setId(quint32 id){
		this->id = id;
	}

	void setName(const QString& nname)
	{
		this->name = nname;
	}

	void setType(Type type){
		this->type = type;
	}
	void setPassword(const QString& npwd)
	{
		password = npwd;
	}
	void setLocked(bool b)
	{
		locked = b;
	}
	void setSignName(const QString& s){
		signName = s;
	}
private:
	quint32 id;
	QString name,signName;
	QString password;
	Type type;
	bool locked; //是否停用。停用为true
	QDate createDate; //帐号创建时间

};

#endif /* USER_H_ */
